package org.design;

import java.util.ArrayList;
import java.util.List;

import org.adapter.ProductAdapter;
import org.cmn.ProductPojo;

import android.app.Activity;
import android.os.Bundle;
import android.widget.ListView;

public class Products extends Activity {
	private List<ProductPojo> allProducts;
	private ProductAdapter prAdapter;

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.products);

		allProducts = new ArrayList<ProductPojo>();
		allProducts.add(new ProductPojo("Book"));
		allProducts.add(new ProductPojo("Bicycle"));
		allProducts.add(new ProductPojo("Phone"));
		allProducts.add(new ProductPojo("Tablet"));
		allProducts.add(new ProductPojo("Video"));
		allProducts.add(new ProductPojo("TV"));
		allProducts.add(new ProductPojo("X-BOX"));

		prAdapter = new ProductAdapter(this, allProducts);

		ListView list = (ListView) findViewById(R.id.allProducts);
		list.setClickable(true);
		list.setAdapter(prAdapter);

	}
}
